<?php 
require_once('config.php');
/**
 *  class MySQL to get the MySQL connecntion etc
 *
 *  static
 *  
 *  @version 0.2
 */
class MySQL{
  /**
   *  function: function get_con()
   *
   *  description: to get the connection from mysql db with the information from config.php
   *
   *  param none
   *
   *  return boolean
   *
   *  @since version: 0.2 
   */
  static function get_con()
  {
    $con = mysql_connect(mysql_host,mysql_user,mysql_password);
    if(!$con)
      {
	return null;
      }
    if(!mysql_select_db(mysql_db,$con))
      {
	return null;
      }
    return $con;
  }
  /**
   *  function: ckstr($str)
   *
   *  description: to check is a str is validate
   *
   *  param string $str
   *
   *  return boolean
   *
   *  @since version: 0.2 
   */
  static function ckstr($str)
  {
    $invalid_char_list = ",!#$%^&*=-+~`'\\/\"";
    if(FALSE===strpbrk($str,$invalid_char_list))
      return true;
    return false;
  }

}
?>